import registerView from '../views/register.art'

class Register{
    constructor(){
        this.num,
        this.psw
    }

    render(){
        let that = this
        let registerViewHtml = registerView()
        $('#root').html(registerViewHtml)

        $('.left').on('tap',function(){
            window.history.back()
        })
        $('.btn').on('tap',function(){
            if($("input[type='checkbox']").is(':checked')){
                if($('.input1').val() && $('.input2').val()){
                    let hhh = {
                        num:$('.input1').val(),
                        psw:$('.input2').val()
                    }
                    window.localStorage.setItem('user',JSON.stringify(hhh))
                    JSON.parse(window.localStorage.getItem('user'))
                    console.log(JSON.parse(window.localStorage.getItem('user')).num)
                    location.hash = 'profile'
                }
            }
            else{
                console.log(444)
            }
        })
        $("input[type='checkbox']").on('tap',function(){
            console.log($("input[type='checkbox']").prop('checked'));
        })
    }
}
export default new Register()